/*
*    Phantom Test Driver v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
 * PTDToolBar.java
 *
 * Created on September 20, 2005, 6:14 PM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package ptd;

import javax.swing.JButton;
import javax.swing.ImageIcon;

import javax.swing.border.EmptyBorder;

/**
 *
 * @author John
 */
public class PTDToolBar extends javax.swing.JToolBar{
    
    public JButton NewScriptButton;
    public JButton NewSuiteButton;
    
    public JButton OpenScriptButton;
    public JButton OpenSuiteButton;
    public JButton OpenDeclsButton;
    
    public JButton RunScriptButton;
    public JButton RunSuiteButton;
    public JButton StopButton;
    
    public JButton SaveScriptButton;
    public JButton SaveSuiteButton;
    public JButton SaveAllButton;
    public JButton SaveDeclsButton;

    public JButton RecordScriptButton;
    public JButton RecordDeclButton;
    
    public JButton DebugScriptButton;
    public JButton DebugStopButton;
    public JButton DebugStepOverButton;
    public JButton DebugStepIntoButton;
    public JButton DebugStepOutButton;
    public JButton DebugToggleBptButton;
    public JButton DebugContinueButton;


    
    /** Creates a new instance of PTDToolBar */
    public PTDToolBar() {

        //                                     T   L   B   R
        EmptyBorder aBorder = new EmptyBorder( 2,  4,  2,  4);

        NewScriptButton = new JButton();
        NewScriptButton.setBorder(aBorder);
        NewSuiteButton = new JButton();
        NewSuiteButton.setBorder(aBorder);
        
        
        OpenScriptButton = new JButton();
        OpenScriptButton.setBorder(aBorder);
        OpenSuiteButton = new JButton();
        OpenSuiteButton.setBorder(aBorder);
        OpenDeclsButton = new JButton();
        OpenDeclsButton.setBorder(aBorder);
         
        RunScriptButton = new JButton();
        RunScriptButton.setBorder(aBorder);
        RunSuiteButton = new JButton();
        RunSuiteButton.setBorder(aBorder);
        StopButton = new JButton();
        StopButton.setBorder(aBorder);
        
        SaveScriptButton = new JButton();
        SaveScriptButton.setBorder(aBorder);
        SaveSuiteButton = new JButton();
        SaveSuiteButton.setBorder(aBorder);
        SaveAllButton = new JButton();
        SaveAllButton.setBorder(aBorder);
        SaveDeclsButton = new JButton();
        SaveDeclsButton.setBorder(aBorder);
        
        RecordScriptButton = new JButton();
        RecordScriptButton.setBorder(aBorder);
        RecordDeclButton = new JButton();
        RecordDeclButton.setBorder(aBorder);

        DebugScriptButton = new JButton();
        DebugScriptButton.setBorder(aBorder);
        DebugStopButton = new JButton();
        DebugStopButton.setBorder(aBorder);
        DebugContinueButton = new JButton();
        DebugContinueButton.setBorder(aBorder);
        DebugStepOverButton = new JButton();
        DebugStepOverButton.setBorder(aBorder);
        DebugStepIntoButton = new JButton();
        DebugStepIntoButton.setBorder(aBorder);
        DebugStepOutButton = new JButton();
        DebugStepOutButton.setBorder(aBorder);
        DebugToggleBptButton = new JButton();
        DebugToggleBptButton.setBorder(aBorder);



        
        ImageIcon a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_NEW_SCRIPT);
        NewScriptButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_NEW_SUITE);
        NewSuiteButton.setIcon(a);
        
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_OPEN_SCRIPT);
        OpenScriptButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_OPEN_SUITE);
        OpenSuiteButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_OPEN_DECL);
        OpenDeclsButton.setIcon(a);
        
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_RUN_SCRIPT);
        RunScriptButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_RUN_SUITE);
        RunSuiteButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_STOP_SCRIPT);
        StopButton.setIcon(a);

        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_SAVE_SCRIPT);
        SaveScriptButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_SAVE_SUITE);
        SaveSuiteButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_SAVE_ALL);
        SaveAllButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_SAVE_DECL);
        SaveDeclsButton.setIcon(a);

        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_RECORD_SCRIPT);
        RecordScriptButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_RECORD_DECL);
        RecordDeclButton.setIcon(a);

        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_DEBUG_SCRIPT);
        DebugScriptButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_STOP_DEBUG);
        DebugStopButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_CONTINUE);
        DebugContinueButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_STEP_OVER);
        DebugStepOverButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_STEP_INTO);
        DebugStepIntoButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_STEP_OUT);
        DebugStepOutButton.setIcon(a);
        a = PTDImageLoader.getImageIcon(PTDImageLoader.IMG_TOGGLE_BPT);
        DebugToggleBptButton.setIcon(a);


        
        NewScriptButton.setToolTipText("New File");
        NewSuiteButton.setToolTipText("New Suite");

        OpenScriptButton.setToolTipText("Open File");
        OpenSuiteButton.setToolTipText("Open Suite");
        OpenDeclsButton.setToolTipText("Open Declarations");
        
        RunScriptButton.setToolTipText("Run Script");
        RunSuiteButton.setToolTipText("Run Suite");
        StopButton.setToolTipText("Stop Run");
        
        
        SaveScriptButton.setToolTipText("Save Script");
        SaveSuiteButton.setToolTipText("Save Suite");
        SaveAllButton.setToolTipText("Save All Scripts");
        SaveDeclsButton.setToolTipText("Save Declarations");

        RecordScriptButton.setToolTipText("Record Script");
        RecordDeclButton.setToolTipText("Record Declarations");
        
        DebugScriptButton.setToolTipText("Debug Script");
        DebugStopButton.setToolTipText("Stop Debugging");
        DebugContinueButton.setToolTipText("Debug - Continue");
        DebugStepOverButton.setToolTipText("Debug - Step Over");
        DebugStepIntoButton.setToolTipText("Debug - Step Into");
        DebugStepOutButton.setToolTipText("Debug - Step Out");
        DebugToggleBptButton.setToolTipText("Debug - Toggle Breakpoint");
        
        
        
        add("New", NewScriptButton);
        add("New", NewSuiteButton);
        
        addSeparator();
        
        add("Open", OpenScriptButton);
        add("Open", OpenSuiteButton);
        add("Open", OpenDeclsButton);
        
        addSeparator();
        
        add("Save Script", SaveScriptButton);
        add("Save All Scripts", SaveAllButton);
        add("Save Suite", SaveSuiteButton);
        add("Save Declarations", SaveDeclsButton);
        
        addSeparator();
        
        add("Run Script", RunScriptButton);
        add("Run Suite", RunSuiteButton);
        add("Stop", StopButton);
        
        addSeparator();
        
        add("Record Script", RecordScriptButton);
        add("Record Declarations", RecordDeclButton);
        
        addSeparator();
        
        add("Debug Script", DebugScriptButton);
        add("Debug Stop", DebugStopButton);
        add("Debug - Continue", DebugContinueButton);
        add("Debug - Step Over", DebugStepOverButton);
        add("Debug - Step Into", DebugStepIntoButton);
        add("Debug - Step Out", DebugStepOutButton);
        add("Debug - Toggle Breakpoint", DebugToggleBptButton);
    
    }
    
}
